package io.renren.modules.skate.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.renren.common.service.impl.CrudServiceImpl;
import io.renren.common.constant.Constant;
import io.renren.common.utils.ConvertUtils;
import io.renren.modules.skate.dao.FCompetitionDao;
import io.renren.modules.skate.dto.FClubDTO;
import io.renren.modules.skate.dto.FCompetitionDTO;
import io.renren.modules.skate.entity.FClubEntity;
import io.renren.modules.skate.entity.FCompetitionEntity;
import io.renren.modules.skate.service.FCompetitionService;
import io.renren.modules.security.user.SecurityUser;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * 赛事表
 *
 * @author Mark sunlightcs@gmail.com
 * @since 3.0 2023-11-28
 */
@Service
public class FCompetitionServiceImpl extends CrudServiceImpl<FCompetitionDao, FCompetitionEntity, FCompetitionDTO> implements FCompetitionService {

    @Override
    public QueryWrapper<FCompetitionEntity> getWrapper(Map<String, Object> params){
        QueryWrapper<FCompetitionEntity> wrapper = new QueryWrapper<>();


        return wrapper;
    }

    @Override
    public FCompetitionDTO queryByName(String name) {

        FCompetitionEntity fCompetitionEntity = baseDao.selectOne(new QueryWrapper<FCompetitionEntity>().eq("name", name).last("limit 1"));


        return ConvertUtils.sourceToTarget(fCompetitionEntity, currentDtoClass());
    }


}